var camera, scene, renderer;
var geometry, material, mesh;
var controls;

init();
animate();

function init()
{
  camera = new THREE.PerspectiveCamera(
      75, window.innerWidth / window.innerHeight, 1, 10000 );
  camera.position.z = 4;
  controls = new THREE.OrbitControls( camera, document.getElementById("span") );
  controls.addEventListener( 'change', renderer );

  scene = new THREE.Scene();

  set_geometry();

  renderer = new THREE.CanvasRenderer();
  span = document.getElementById("span")
  renderer.setSize( window.innerWidth/2,  window.innerHeight/2);
  span.appendChild( renderer.domElement );
}

function animate()
{
  requestAnimationFrame( animate );
  renderer.render( scene, camera );
}
